{extend name='common/_container'}
{block name="content"}
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<div class="form-horizontal" id="CodeInfoForm">
			<div class="row">
				<div class="col-sm-12">
				<!-- form start -->
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人姓名：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_name" value="" name="insured_name" class="form-control" placeholder="请输入被保人姓名">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人类型：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_type" value="" name="insured_type" class="form-control" placeholder="请输入被保人类型">
							<span class="help-block m-b-none">1：个人、2：企业</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人证件号码：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_card_no" value="" name="insured_card_no" class="form-control" placeholder="请输入被保人证件号码">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人证件类型：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_card_type" value="" name="insured_card_type" class="form-control" placeholder="请输入被保人证件类型">
							<span class="help-block m-b-none">111：居民身份证、811：组织机构代码证书、990：其它</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人证件有效期：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_card_valid" value="" name="insured_card_valid" class="form-control" placeholder="请输入被保人证件有效期">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人性别：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_gender" value="" name="insured_gender" class="form-control" placeholder="请输入被保人性别">
							<span class="help-block m-b-none">0：未知、1：男、2：女、9：未说明的性别</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人电子邮件：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_email" value="" name="insured_email" class="form-control" placeholder="请输入被保人电子邮件">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">被保人手机：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="insured_mobile" value="" name="insured_mobile" class="form-control" placeholder="请输入被保人手机">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">投保人：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="userid" value="" name="userid" class="form-control" placeholder="请输入投保人">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">与投保人关系：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="with_holder_relation" value="" name="with_holder_relation" class="form-control" placeholder="请输入与投保人关系">
							<span class="help-block m-b-none">0：本人 、1：配偶、2：子、3：女4：父亲、5：母亲、8：其它</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">与投保人关系说明：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="with_holder_relation_dec" value="" name="with_holder_relation_dec" class="form-control" placeholder="请输入与投保人关系说明">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">身份证件正面扫描件储存地址：</label>
						<div class="col-sm-6">
							<input type="text" autocomplete="off" id="card_obverse_url" value="" {if condition="config('my.img_show_status') eq true"}onmousemove="showBigPic(this.value)" onmouseout="closeimg()"{/if} name="card_obverse_url" class="form-control" placeholder="请输入身份证件正面扫描件储存地址">
							<span class="help-block m-b-none card_obverse_url_process"></span>
						</div>
						<div class="col-sm-2" style="position:relative; right:30px;">
							<span id="card_obverse_url_upload"></span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">身份证件反面扫描件储存地址：</label>
						<div class="col-sm-6">
							<input type="text" autocomplete="off" id="card_reverse_url" value="" {if condition="config('my.img_show_status') eq true"}onmousemove="showBigPic(this.value)" onmouseout="closeimg()"{/if} name="card_reverse_url" class="form-control" placeholder="请输入身份证件反面扫描件储存地址">
							<span class="help-block m-b-none card_reverse_url_process"></span>
						</div>
						<div class="col-sm-2" style="position:relative; right:30px;">
							<span id="card_reverse_url_upload"></span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">保单名称：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="policy_name" value="" name="policy_name" class="form-control" placeholder="请输入保单名称">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">该订单所属保险公司简称：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="ic_short_name" value="" name="ic_short_name" class="form-control" placeholder="请输入该订单所属保险公司简称">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">产品id：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="product_id" value="" name="product_id" class="form-control" placeholder="请输入产品id">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">对应保险公司id：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="ic_id" value="" name="ic_id" class="form-control" placeholder="请输入对应保险公司id">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">商业险对应保险公司Code：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="ic_code" value="" name="ic_code" class="form-control" placeholder="请输入商业险对应保险公司Code">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">产品类别：</label>
						<div class="col-sm-9">
							<input type="text" autocomplete="off" id="product_category" value="" name="product_category" class="form-control" placeholder="请输入产品类别">
							<span class="help-block m-b-none">0：无类别、1：商业险、2：交强险、3：驾乘险）注：当product_type=3且product_category &gt; 0有效&quot;)</span>
						</div>
					</div>
				<!-- form end -->
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			<div class="row btn-group-m-t">
				<div class="col-sm-9 col-sm-offset-1">
					<button type="button" class="btn btn-primary" onclick="CodeInfoDlg.add()" id="ensure">
						<i class="fa fa-check"></i>&nbsp;确认提交
					</button>
					<button type="button" class="btn btn-danger" onclick="CodeInfoDlg.close()" id="cancel">
						<i class="fa fa-eraser"></i>&nbsp;取消
					</button>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/static/js/upload.js" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/plugins/layui/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'],function(){});
uploader('card_obverse_url_upload','card_obverse_url','image',false,'','{:getUploadServerUrl()}');
uploader('card_reverse_url_upload','card_reverse_url','image',false,'','{:getUploadServerUrl()}');
var CodeInfoDlg = {
	CodeInfoData: {},
	validateFields: {
	 }
}

CodeInfoDlg.collectData = function () {
	this.set('id').set('insured_name').set('insured_type').set('insured_card_no').set('insured_card_type').set('insured_card_valid').set('insured_gender').set('insured_email').set('insured_mobile').set('userid').set('with_holder_relation').set('with_holder_relation_dec').set('card_obverse_url').set('card_reverse_url').set('policy_name').set('ic_short_name').set('product_id').set('ic_id').set('ic_code').set('product_category');
};

CodeInfoDlg.add = function () {
	 this.clearData();
	 this.collectData();
	 if (!this.validate()) {
	 	return;
	 }
	 var ajax = new $ax(Feng.ctxPath + "/Insurance.InsurancePolicy/add", function (data) {
	 	if ('00' === data.status) {
	 		Feng.success(data.msg,1000);
	 		window.parent.CodeGoods.table.refresh();
	 		CodeInfoDlg.close();
	 	} else {
	 		Feng.error(data.msg + "！",1000);
		 }
	 })
	 ajax.set(this.CodeInfoData);
	 ajax.start();
};


</script>
<script src="__PUBLIC__/static/js/base.js" charset="utf-8"></script>
{/block}
